'use strict'

const Router = require('koa-router')
const controllers = require('../controllers')
const jwtMiddleware = require('../middlewares/jwt')
const categoryRouter = require('./private/category')
const tagRouter = require('./private/tag')
const articleRouter = require('./private/article')
const fileManagerRouter = require('./private/fileManager')
const visitLogRouter = require('./private/visitLog')
const friendRouter = require('./private/friend')

const router = new Router()
router.prefix('/api')
router.use(jwtMiddleware)

// 分类管理
categoryRouter.initRoute(router, controllers.category)
// 标签管理
tagRouter.initRoute(router, controllers.tagController)
// 文章管理
articleRouter.initRoute(router, controllers.articleController)
// 文件管理
fileManagerRouter.initRoute(router, controllers.fileManagerController)

visitLogRouter.initRoute(router, controllers.visitLogController)

friendRouter.initRoute(router, controllers.friendController)


module.exports = router
